﻿/*----------------------------------------------------------------------------------------
*
*  Copyright 2019, Gao Hai Hui, <fromzeropoint@126.com>.  All rights reserved.
*  https://gitee.com/helloworldghh/xoskit.git
*  Use of this source code is governed by a MIT license
*  that can be found in the License file.
*
----------------------------------------------------------------------------------------*/
#ifndef __IMPL_MGR_H__
#define __IMPL_MGR_H__

namespace xos_container
{

    class mgr : public i_container
    {
    public:
        typedef xos::release_impl< mgr > T;

    public:
        mgr();
        ~mgr();

    public:
        static int static_init( i_container ** ppv );
        static mgr * get();

    public:
        // return obj
        xos_aio::i_aio_mgr * aio();
        xos_common::i_common * common();
        xos_compress::i_compress_mgr * compress();
        xos::i_xos * xos();
        xos_curl::i_curl_mgr * curl();
        xos_encrypt::i_encrypt_mgr * encrypt();
        xos_http::i_http_mgr * http();
        xos_json::i_json_mgr * json();
        xos_log::i_log * log();
        xos_box::i_box_mgr * box();
        xos_odbc::i_odbc_mgr * odbc();
        xos_package::i_package_mgr * package();
        xos_sqlite::i_sqlite_mgr * sqlite();
        xos_xml::i_xml_mgr * xml();

        // need release
        xos_box::i_big_buf * big_buf();
        xos_box::i_buf * buf();
        xos_box::i_msg * msg();
        xos_box::i_list * list();
        xos_box::i_property * prop();
        xos_box::i_variant * vt();
        xos_box::i_lock_obj * lobj();
        xos_box::i_lock_num * lnum();
        xos_http::i_session * session();
        xos_http::i_cookie * cookie();
        xos_common::i_md5 * md5();
        xos::i_lock * mutex();
        xos::i_lock * spin();
        xos::i_file * file();
        xos::i_dir * dir();
        xos::i_time * tm();

        // need not release
        xos_common::i_misc * common_misc();
        xos_box::i_serial * serial();
        xos_box::i_heart * heart();
        xos::i_misc * misc();
        xos::i_crt * crt();

        // helper
        const char * exe_path();

    public:
        int put_back_to_pool( T * pT, bool bLock );
        int init();
        int term();

    };

} // xos_container

#endif // __IMPL_MGR_H__
